#/*****************************************************************************
#* Keppe Messenger (KMP) Keppe Project-Team User Messaging System
#* Copyright (C) 2013-2014 Keppe Project-Team
#*
#* This program is free software: you can redistribute it and/or modify
#* it under the terms of the GNU General Public License as published by
#* the Free Software Foundation, either version 3 of the License, or
#* (at your option) any later version.
#*
#* This program is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#* GNU General Public License for more details.
#*
#* You should have received a copy of the GNU General Public License
#* along with this program.  If not, see <http://www.gnu.org/licenses/>.
#*****************************************************************************/

# DEFINE QT LIBS AND CONFIG
QT       += core gui network
isEqual(QT_MAJOR_VERSION, 5): QT += widgets multimedia

TEMPLATE = app
CONFIG += app_bundle

# DEFINE SYSTEM
isEqual(QT_MAJOR_VERSION, 4): DEFINES += "QT4"
isEqual(QT_MAJOR_VERSION, 5): DEFINES += "QT5"
unix: DEFINES += "UNIX"
macx: DEFINES += "MACX"

# DEFINE COMPILER
*g++*: DEFINES += "GCC"
win32-msvc*: DEFINES += "MSVC"

# DEFINE COMPILER VERSION
win32-msvc2005: DEFINES += "MSVC2005" # VC2005
win32-msvc2008: DEFINES += "MSVC2008" # VC2008
win32-msvc2010: DEFINES += "MSVC2010" # VC2010
win32-msvc2012: DEFINES += "MSVC2012" # VC2012
win32-msvc2013: DEFINES += "MSVC2013" # VC2013

# DEFINE SHARED OR STATIC
shared: DEFINES += "SHARED"
static: DEFINES += "STATIC"

# DEFINE PRODUCT VESION, ICON AND NAME
VERSION = 1.0.0.32

win32: TARGET = KeppeMessenger
unix: TARGET = keppemessenger
macx: TARGET = "Keppe Messenger"
macx: ICON = km.icns
DEPLOYMENT.display_name = Keppe Messenger

# DEFINE SOURCES, HEADERS AND FORMS
SOURCES += main.cpp \
    AvatarThread.cpp \
    frmAboutKeppe.cpp \
    frmAboutKMPQ.cpp \
    frmChangePassword.cpp \
    frmChat.cpp \
    frmConfig.cpp \
    frmContactRequests.cpp \
    frmLogin.cpp \
    frmProfile.cpp \
    frmProfileInfo.cpp \
    frmUpdate.cpp \
    NotificationWidget.cpp \
    UpdateThread.cpp

HEADERS  += config.h \
    AvatarThread.h \
    frmAboutKeppe.h \
    frmAboutKMPQ.h \
    frmChangePassword.h \
    frmChat.h \
    frmConfig.h \
    frmContactRequests.h \
    frmLogin.h \
    frmProfile.h \
    frmProfileInfo.h \
    frmUpdate.h \
    NotificationWidget.h \
    UpdateThread.h

FORMS += frmAboutKeppe.ui \
    frmAboutKMPQ.ui \
    frmChangePassword.ui \
    frmChat.ui \
    frmConfig.ui \
    frmContactRequests.ui \
    frmLogin.ui \
    frmProfile.ui \
    frmProfileInfo.ui \
    NotificationWidget.ui \
    frmUpdate.ui

# DEFINE OTHER PROJECT FILES AND TRANSLATION
OTHER_FILES = app.rc \
    km.ico \
    *.iss \
    res/*.html \
    res/*.png \
    res/*.ts \
    res/*.wav \
    res/*.xpm \

RESOURCES += \
    res/res.qrc

TRANSLATIONS += \
    res/km_de.ts

win32: RC_FILE = app.rc

# DEFINE MESSENGER LIBS AND ADDITONAL FILES FOR THE INSTALLATION
INCLUDEPATH += ../include
shared: win32: LIBS += -L$$OUT_PWD/../KMsgFw/release -L$$OUT_PWD/../KMsgFw/debug -L$$OUT_PWD/../KGuiFw/release -L$$OUT_PWD/../KGuiFw/debug -llibkmsgfw1 -llibkguifw1
static: win32: LIBS += -L$$OUT_PWD/../KMsgFw/release -L$$OUT_PWD/../KMsgFw/debug -L$$OUT_PWD/../KGuiFw/release -L$$OUT_PWD/../KGuiFw/debug -lkmsgfw -lkguifw
shared: macx: LIBS += -F$$OUT_PWD/../KMsgFw -F$$OUT_PWD/../KGuiFw -framework kmsgfw -framework kguifw
static: macx: LIBS += -L$$OUT_PWD/../KMsgFw -L$$OUT_PWD/../KGuiFw -lkmsgfw -lkguifw
unix: !macx: LIBS += -L$$OUT_PWD/../KMsgFw -L$$OUT_PWD/../KGuiFw -lkmsgfw -lkguifw
ANDROID_EXTRA_LIBS = $$OUT_PWD/../KMsgFw/libkmsgfw.so $$OUT_PWD/../KGuiFw/libkguifw.so

static: isEqual(QT_MAJOR_VERSION, 5): CONFIG(WithStyles): LIBS += -L$$OUT_PWD/../styles/cleanlooks -lqcleanlooksstyle -L$$OUT_PWD/../styles/motif -lqmotifstyle -L$$OUT_PWD/../styles/plastique -lqplastiquestyle
static: isEqual(QT_MAJOR_VERSION, 5): CONFIG(WithStyles): DEFINES += WithStyles

unix: !macx: DEFINES += ChatIn=\\\"/opt/keppemessenger/res/ChatIn.wav\\\"
unix: !macx: DEFINES += TranslationPath=\\\"/opt/keppemessenger/trplugs\\\"
unix: !macx: scripts.path = /usr/local/bin
unix: !macx: scripts.files = $$PWD/bin/*
unix: !macx: resfiles.path = /opt/keppemessenger/res
unix: !macx: resfiles.files = $$PWD/res/ChatIn.wav
unix: !macx: target.path = /opt/keppemessenger/bin
unix: !macx: INSTALLS += target scripts resfiles
